package 我的JDK基础数据结构.ConcurrentHashMap;

import java.util.concurrent.ConcurrentHashMap;

public class Test {

    public static void main(String[] args) throws InterruptedException {
        ConcurrentHashMap<Integer, Integer> concurrentHashMap = new ConcurrentHashMap<>();
        new Thread(() -> {
            for (int i = 0; i < 100; i++) {
                concurrentHashMap.put(i, i);
            }
        }).start();
        for (int i = 0; i < 200; i++) {
            concurrentHashMap.put(i, i);
        }
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                concurrentHashMap.size();
            }).start();
        }
        concurrentHashMap.size();
    }

}
